<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.10.0"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SARibbon: SARibbonWidget类 参考</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<script type="text/javascript" src="clipboard.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript" src="cookie.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr id="projectrow">
  <td id="projectlogo"><img alt="Logo" src="SA-logo.png"/></td>
  <td id="projectalign">
   <div id="projectname">SARibbon<span id="projectnumber">&#160;2.4.2</span>
   </div>
   <div id="projectbrief">SARibbon wiki</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.10.0 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function(){initNavTree('class_s_a_ribbon_widget.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">载入中...</div>
<div class="SRStatus" id="Searching">搜索中...</div>
<div class="SRStatus" id="NoMatches">未找到</div>
</div>
</div>
</div>
</div>

<div class="header">
  <div class="summary">
<a href="#nested-classes">类</a> &#124;
<a href="#pub-methods">Public 成员函数</a> &#124;
<a href="#properties">属性</a> &#124;
<a href="#friends">友元</a> &#124;
<a href="class_s_a_ribbon_widget-members.html">所有成员列表</a>  </div>
  <div class="headertitle"><div class="title">SARibbonWidget类 参考</div></div>
</div><!--header-->
<div class="contents">

<p>带SARibbonBar的Widget  
 <a href="#details">更多...</a></p>

<p><code>#include &lt;<a class="el" href="_s_a_ribbon_widget_8h_source.html">SARibbonWidget.h</a>&gt;</code></p>
<div class="dynheader">
类 SARibbonWidget 继承关系图:</div>
<div class="dyncontent">
 <div class="center">
  <img src="class_s_a_ribbon_widget.png" alt=""/>
 </div></div>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="nested-classes" name="nested-classes"></a>
类</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_s_a_ribbon_widget_1_1_private_data.html">PrivateData</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The <a class="el" href="class_s_a_ribbon_widget_1_1_private_data.html" title="The SARibbonWidget::PrivateData class">SARibbonWidget::PrivateData</a> class  <a href="class_s_a_ribbon_widget_1_1_private_data.html#details">更多...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public 成员函数</h2></td></tr>
<tr class="memitem:af3c3a6de1e61e52d991803ae76e54f10" id="r_af3c3a6de1e61e52d991803ae76e54f10"><td class="memItemLeft" align="right" valign="top"><a id="af3c3a6de1e61e52d991803ae76e54f10" name="af3c3a6de1e61e52d991803ae76e54f10"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>SARibbonWidget</b> (QWidget *parent=nullptr)</td></tr>
<tr class="separator:af3c3a6de1e61e52d991803ae76e54f10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4ef9b671f67ac0d78ab7aa9f1b6b65dd" id="r_a4ef9b671f67ac0d78ab7aa9f1b6b65dd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_s_a_ribbon_bar.html">SARibbonBar</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4ef9b671f67ac0d78ab7aa9f1b6b65dd">ribbonBar</a> () const</td></tr>
<tr class="memdesc:a4ef9b671f67ac0d78ab7aa9f1b6b65dd"><td class="mdescLeft">&#160;</td><td class="mdescRight">返回ribbonbar，如果不是使用ribbon模式，返回nullptr  <br /></td></tr>
<tr class="separator:a4ef9b671f67ac0d78ab7aa9f1b6b65dd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c1218ddd82fbb37ca233c614e8fd060" id="r_a5c1218ddd82fbb37ca233c614e8fd060"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a5c1218ddd82fbb37ca233c614e8fd060">setRibbonBar</a> (<a class="el" href="class_s_a_ribbon_bar.html">SARibbonBar</a> *bar)</td></tr>
<tr class="memdesc:a5c1218ddd82fbb37ca233c614e8fd060"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置ribbonbar  <br /></td></tr>
<tr class="separator:a5c1218ddd82fbb37ca233c614e8fd060"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4b399d4d055bf042b49b9c693fbbaf6c" id="r_a4b399d4d055bf042b49b9c693fbbaf6c"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a4b399d4d055bf042b49b9c693fbbaf6c">setRibbonTheme</a> (SARibbonTheme theme)</td></tr>
<tr class="memdesc:a4b399d4d055bf042b49b9c693fbbaf6c"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="class_s_a_ribbon_main_window.html#aa46d6ad466c111e657ef3b00c0944d65" title="SARibbonMainWindow::setRibbonTheme">SARibbonMainWindow::setRibbonTheme</a>  <br /></td></tr>
<tr class="separator:a4b399d4d055bf042b49b9c693fbbaf6c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f02c8666880a8d73eec8655d008bb02" id="r_a4f02c8666880a8d73eec8655d008bb02"><td class="memItemLeft" align="right" valign="top"><a id="a4f02c8666880a8d73eec8655d008bb02" name="a4f02c8666880a8d73eec8655d008bb02"></a>
SARibbonTheme&#160;</td><td class="memItemRight" valign="bottom"><b>ribbonTheme</b> () const</td></tr>
<tr class="separator:a4f02c8666880a8d73eec8655d008bb02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31e2975a122b738c257c95dc6ca3c745" id="r_a31e2975a122b738c257c95dc6ca3c745"><td class="memItemLeft" align="right" valign="top"><a id="a31e2975a122b738c257c95dc6ca3c745" name="a31e2975a122b738c257c95dc6ca3c745"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>isUseRibbon</b> () const</td></tr>
<tr class="separator:a31e2975a122b738c257c95dc6ca3c745"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aeb861377f04cd2a429531c9946c593b9" id="r_aeb861377f04cd2a429531c9946c593b9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#aeb861377f04cd2a429531c9946c593b9">setWidget</a> (QWidget *w)</td></tr>
<tr class="memdesc:aeb861377f04cd2a429531c9946c593b9"><td class="mdescLeft">&#160;</td><td class="mdescRight">设置窗口  <br /></td></tr>
<tr class="separator:aeb861377f04cd2a429531c9946c593b9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8da992ae6fa57f3cafcee9e283e1eaff" id="r_a8da992ae6fa57f3cafcee9e283e1eaff"><td class="memItemLeft" align="right" valign="top">QWidget *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a8da992ae6fa57f3cafcee9e283e1eaff">widget</a> () const</td></tr>
<tr class="memdesc:a8da992ae6fa57f3cafcee9e283e1eaff"><td class="mdescLeft">&#160;</td><td class="mdescRight">获取设置的窗口  <br /></td></tr>
<tr class="separator:a8da992ae6fa57f3cafcee9e283e1eaff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a74a1c1d1307a04dcbc759df96bdcdec8" id="r_a74a1c1d1307a04dcbc759df96bdcdec8"><td class="memItemLeft" align="right" valign="top"><a id="a74a1c1d1307a04dcbc759df96bdcdec8" name="a74a1c1d1307a04dcbc759df96bdcdec8"></a>
QWidget *&#160;</td><td class="memItemRight" valign="bottom"><b>takeWidget</b> ()</td></tr>
<tr class="separator:a74a1c1d1307a04dcbc759df96bdcdec8"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="properties" name="properties"></a>
属性</h2></td></tr>
<tr class="memitem:a6ed949d1b9d9034abd1b720da1914a14" id="r_a6ed949d1b9d9034abd1b720da1914a14"><td class="memItemLeft" align="right" valign="top"><a id="a6ed949d1b9d9034abd1b720da1914a14" name="a6ed949d1b9d9034abd1b720da1914a14"></a>
SARibbonTheme&#160;</td><td class="memItemRight" valign="bottom"><b>ribbonTheme</b></td></tr>
<tr class="separator:a6ed949d1b9d9034abd1b720da1914a14"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="friends" name="friends"></a>
友元</h2></td></tr>
<tr class="memitem:a1fb4c4fe02f19abd32864cc35bc2417a" id="r_a1fb4c4fe02f19abd32864cc35bc2417a"><td class="memItemLeft" align="right" valign="top"><a id="a1fb4c4fe02f19abd32864cc35bc2417a" name="a1fb4c4fe02f19abd32864cc35bc2417a"></a>
class&#160;</td><td class="memItemRight" valign="bottom"><b>SARibbonBar</b></td></tr>
<tr class="separator:a1fb4c4fe02f19abd32864cc35bc2417a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<div class="textblock"><p>带SARibbonBar的Widget </p>
<dl class="section note"><dt>注解</dt><dd>注意，SARibbonWidget利用了布局来把ribbonbar放到最顶部，不要给此widget添加布局，否则会导致布局异常， 正确的做法是把布局的窗口通过setWidget设置进SARibbonWidget </dd></dl>
</div><h2 class="groupheader">成员函数说明</h2>
<a id="a4ef9b671f67ac0d78ab7aa9f1b6b65dd" name="a4ef9b671f67ac0d78ab7aa9f1b6b65dd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4ef9b671f67ac0d78ab7aa9f1b6b65dd">&#9670;&#160;</a></span>ribbonBar()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_s_a_ribbon_bar.html">SARibbonBar</a> * SARibbonWidget::ribbonBar </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>返回ribbonbar，如果不是使用ribbon模式，返回nullptr </p>
<dl class="section return"><dt>返回</dt><dd></dd></dl>

</div>
</div>
<a id="a5c1218ddd82fbb37ca233c614e8fd060" name="a5c1218ddd82fbb37ca233c614e8fd060"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c1218ddd82fbb37ca233c614e8fd060">&#9670;&#160;</a></span>setRibbonBar()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SARibbonWidget::setRibbonBar </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="class_s_a_ribbon_bar.html">SARibbonBar</a> *</td>          <td class="paramname"><span class="paramname"><em>bar</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置ribbonbar </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">bar</td><td></td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a id="a4b399d4d055bf042b49b9c693fbbaf6c" name="a4b399d4d055bf042b49b9c693fbbaf6c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4b399d4d055bf042b49b9c693fbbaf6c">&#9670;&#160;</a></span>setRibbonTheme()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SARibbonWidget::setRibbonTheme </td>
          <td>(</td>
          <td class="paramtype">SARibbonTheme</td>          <td class="paramname"><span class="paramname"><em>theme</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p><a class="el" href="class_s_a_ribbon_main_window.html#aa46d6ad466c111e657ef3b00c0944d65" title="SARibbonMainWindow::setRibbonTheme">SARibbonMainWindow::setRibbonTheme</a> </p>
<p>注意主题在构造函数设置主题会不完全生效，使用QTimer投放到队列最后执行即可 </p><div class="fragment"><div class="line">QTimer::singleShot(0, <span class="keyword">this</span>, [ <span class="keyword">this</span> ]() { this-&gt;<a class="code hl_function" href="#a4b399d4d055bf042b49b9c693fbbaf6c">setRibbonTheme</a>(SARibbonMainWindow::RibbonThemeDark); });</div>
<div class="ttc" id="aclass_s_a_ribbon_widget_html_a4b399d4d055bf042b49b9c693fbbaf6c"><div class="ttname"><a href="#a4b399d4d055bf042b49b9c693fbbaf6c">SARibbonWidget::setRibbonTheme</a></div><div class="ttdeci">void setRibbonTheme(SARibbonTheme theme)</div><div class="ttdoc">SARibbonMainWindow::setRibbonTheme</div><div class="ttdef"><b>Definition</b> SARibbonWidget.cpp:80</div></div>
</div><!-- fragment --> <dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">theme</td><td></td></tr>
  </table>
  </dd>
</dl>
<p>在设置qss后需要针对margin信息重新设置进SARibbonTabBar中 office2013.qss的margin信息如下设置 margin-top: 0px; margin-right: 0px; margin-left: 5px; margin-bottom: 0px;</p>
<p>在设置qss后需要针对margin信息重新设置进SARibbonTabBar中 office2021.qss的margin信息如下设置 margin-top: 0px; margin-right: 5px; margin-left: 5px; margin-bottom: 0px;</p>

</div>
</div>
<a id="aeb861377f04cd2a429531c9946c593b9" name="aeb861377f04cd2a429531c9946c593b9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aeb861377f04cd2a429531c9946c593b9">&#9670;&#160;</a></span>setWidget()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void SARibbonWidget::setWidget </td>
          <td>(</td>
          <td class="paramtype">QWidget *</td>          <td class="paramname"><span class="paramname"><em>w</em></span></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>设置窗口 </p>
<dl class="params"><dt>参数</dt><dd>
  <table class="params">
    <tr><td class="paramname">窗口指针</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section note"><dt>注解</dt><dd>窗口的所有权归SARibbonWidget管理 </dd></dl>
<dl class="section see"><dt>参见</dt><dd><a class="el" href="#a8da992ae6fa57f3cafcee9e283e1eaff" title="获取设置的窗口">widget</a> </dd></dl>
<dl class="section note"><dt>注解</dt><dd>原来设置的窗口会被delete </dd></dl>

</div>
</div>
<a id="a8da992ae6fa57f3cafcee9e283e1eaff" name="a8da992ae6fa57f3cafcee9e283e1eaff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8da992ae6fa57f3cafcee9e283e1eaff">&#9670;&#160;</a></span>widget()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">QWidget * SARibbonWidget::widget </td>
          <td>(</td>
          <td class="paramname"><span class="paramname"></span></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>获取设置的窗口 </p>
<dl class="section return"><dt>返回</dt><dd>如果没有，返回nullptr </dd></dl>

</div>
</div>
<hr/>该类的文档由以下文件生成:<ul>
<li>C:/src/Qt/SARibbon/src/SARibbonBar/<a class="el" href="_s_a_ribbon_widget_8h_source.html">SARibbonWidget.h</a></li>
<li>C:/src/Qt/SARibbon/src/SARibbonBar/<b>SARibbonWidget.cpp</b></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="class_s_a_ribbon_widget.html">SARibbonWidget</a></li>
    <li class="footer">制作者 <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0 </li>
  </ul>
</div>
</body>
</html>
